package sourceFiles;

import java.util.LinkedList;

import Exceptions.InvalidChildID;
import Exceptions.InvalidGuardianID;

/**
 * A class containing all the relevant data for a guardian registered to the
 * system, password issued during registration, and the billing info enterd
 * during registration. Inherited class form PersonEntry
 * 
 * @author LASO-Team
 * 
 */
public class GuardianEntry extends PersonEntry {

	private final String password;
	private final Integer billingInfo;
	private LinkedList<ChildEntry> childrenList;

	/*--------------------------------------------------------------------------*/

	/**
	 * A simple constructor for the GuardianEntry
	 * @param id
	 *            the ID of the guardian.
	 * @param password
	 *            the password that the guardian has.
	 * @param billingInfo
	 *            the number of the guardian's credit card.
	 * @throws InvalidGuardianID
	 *             if the id is invalid.
	 */
	public GuardianEntry(Integer id, String password, Integer billingInfo)
			throws InvalidGuardianID {
		super(id);
		if (id <= 0) {
			throw new InvalidGuardianID();
		}
		this.password = password;
		this.billingInfo = billingInfo;
		this.childrenList = new LinkedList<ChildEntry>();
	}

	/**
	 * A getter for the guardian paswword
	 * @return the password of the guardian.
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * A getter for the billing info of the guardian
	 * @return the billing information of the guardian.
	 */
	public Integer getBillingInfo() {
		return billingInfo;
	}

	/**
	 * Getter for the list of children this guardian controls
	 * @return
	 * 			The list of the children registered for this guardian
	 */
	public LinkedList<ChildEntry> getChildrenList() {
		return childrenList;
	}

	/**
	 * Setter for the list of children this guardian controls
	 * @param childrenList
	 * 						The list of the children registered for this guardian
	 */
	public void setChildrenList(LinkedList<ChildEntry> childrenList) {
		this.childrenList = childrenList;
	}

}
